import request from "@/utils/request"


export const getAllGuide = (data) => {
    return request({
        url: "/api/travel-guide/all",
        method: "post",
        data
    });
}


export const getGuideById = (id) => {
    return request({
        url: `/api/travel-guide/${id}`,
        method: "get"
    });
}


// 修改API调用方法
export const addGuide = (data) => {
    return request({
        url: "/api/travel-guide/add",
        method: "post",
        data
    });
}


export const updateGuide = (data) => {
    return request({
        url: "/api/travel-guide/update",
        method: "put",
        data
    });
}

export const deleteGuide = (id) => {
    return request({
        url: `/api/travel-guide/delete/${id}`,
        method: "get"
    });
}
export const getAllTags= () => {
    return request({
        url: `/api/travel-guide/all`,
        method: "get"
    });
}
export const getTopGuide= (length) => {
    return request({
        url: `/api/travel-guide/hot/${length}`,
        method: "get"
    });
}
export const getTopGuideBySpot= (length) => {
    return request({
        url: `/api/travel-guide/spot/${length}`,
        method: "get"
    });
}